package edu.sctu.zhengsenwen.month201506.day20150618;

/**
 * Created by user15 on 2015/6/18.
 */
public class UseMultipleConstructorDemo {

    public UseMultipleConstructorDemo(){

        MultipleConstructorDemo multipleConstructorDemo1 = new MultipleConstructorDemo();

        MultipleConstructorDemo multipleConstructorDemo2 = new MultipleConstructorDemo(23);

        MultipleConstructorDemo multipleConstructorDemo3 = new MultipleConstructorDemo(15,17);

        System.out.println("默认构造器，a = "+multipleConstructorDemo1.a);
        System.out.println("b = "+multipleConstructorDemo1.b+"\n");

        System.out.println("传入一个参参数的构造器，a= "+multipleConstructorDemo2.a);
        System.out.println("b = "+multipleConstructorDemo2.b);

        System.out.println("传入一个参参数的构造器，a= "+multipleConstructorDemo3.a);
        System.out.println("b = "+multipleConstructorDemo3.b);
    }

    public static void main(String[] args) {
        UseMultipleConstructorDemo useMultipleConstructorDemo = new UseMultipleConstructorDemo();
    }
}
